package com.example.demo.controller;

import com.example.demo.common.Result;
import com.example.demo.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/statistic")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    @GetMapping("/getRidesOnRoute")
    public Result getRidesOnRoute(){
        return statisticsService.getRidesOnRoute();
    }

    @GetMapping("/getSumOfTypeOnRoute")
    public Result getSumOfTypeOnRoute(){
        return statisticsService.getSumOfTypeOnRoute();
    }

    @GetMapping("/getRidesOnTime")
    public Result getRidesOnTime(String checiId){
        return statisticsService.getRidesOnTime(checiId);
    }

}
